using System;
namespace Symbonix.NorSoNet.Security.BLL.Membership {
	
	public class SystemMembershipFactory : IMembershipFactory  {
        /// <summary>
        /// Returns an instance of User factory
        /// [Jalal]
        /// </summary>
        private IUserFactory UserFactory
        {
            get
            {
                return new UserFactory();
            }
        }

        /// <summary>
        /// Returns a generic instance of profile
        /// </summary>
        /// <returns></returns>
        public IUserProfile GetUserProfile()
        {
            return SocialNetworkUserProfile.GetInstance();
		}

        /// <summary>
        /// Loads a specific user instance using given ID
        /// and returns it
        /// [Jalal]
        /// </summary>
        /// <param name="id">ID for which to load user instance</param>
        /// <returns>Specific user instance by the ID</returns>
		public IUser GetUser(int id) {
            return UserFactory.GetUser(id);
		}
		
        /// <summary>
        /// Returns a generic user instance (SystemUser)
        /// [Jalal]
        /// </summary>
        /// <returns>Generic user instance</returns>
		public IUser GetUser() {
            return UserFactory.GetUser();
		}

        /// <summary>
        /// Calls user factory to get an instance of role specific user
        /// (Admin,Member, etc)
        /// [Jalal]
        /// </summary>
        /// <param name="role">Role for which to return instance</param>
        /// <returns>Instance of role specific user</returns>
        public IUser GetUser(string role)
        {
            return UserFactory.GetUser(role);
        }
		
        /// <summary>
        /// Calls user factory to get an instance of currently logged in user
        /// [Jalal]
        /// </summary>
        /// <returns>Currently logged in user instance</returns>
		public IUser GetCurrentUser() {
            return UserFactory.GetCurrentUser();
		}

	}

}
